import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/svg.dart';
import 'package:flutter_uikit/widget/text/text_widget.dart';
import '../../../common/app_resources.dart';

class ChartRowWidget extends StatefulWidget {
  const ChartRowWidget(
      {Key? key,
      required this.text,
      required this.svgPath,
      required this.onTap})
      : super(key: key);

  final String text;
  final String svgPath;
  final VoidCallback onTap;

  @override
  State<ChartRowWidget> createState() => ChartRowWidgetState();
}

class ChartRowWidgetState extends State<ChartRowWidget> {
  @override
  Widget build(BuildContext context) {
    return Material(
      color: Colors.transparent,
      child: InkWell(
        onTap: () {
          widget.onTap();
        },
        child: SizedBox(
          height: 65.w,
          child: Row(
            children: [
              Expanded(
                  child: Row(
                children: [
                  const SizedBox(
                    width: 16,
                  ),
                  SvgPicture.asset(
                    widget.svgPath,
                    width: 32.w,
                    height: 32.w,
                    colorFilter: const ColorFilter.mode(
                        AppColors.colorFF50E4FF, BlendMode.srcIn),
                  ),
                  const SizedBox(width: 18),
                  TextWidget(widget.text, TS_FFFFFFFF_18_W5),
                ],
              )),
              Image.asset("assets/images/common_right_arrow.png",
                  width: 30.w, height: 30.w),
              const SizedBox(
                width: 16,
              )
            ],
          ),
        ),
      ),
    );
  }
}
